﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Pages/Admin/AdminMasterPage.master" AutoEventWireup="true" CodeFile="adaugareAtribute.aspx.cs" Inherits="Pages_Admin_adaugareAtribute" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table style="width: 100%;">
    <tr>
        <td style="width: 350px">
            &nbsp;</td>
        <td style="width: 585px">
            <asp:Panel ID="Panel1" runat="server" BorderStyle="Groove">
                <table style="width:100%;">
                    <tr>
                        <td style="width: 126px">
                            &nbsp;</td>
                        <td>
                            Adaugare Atribut la produs</td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width: 126px">
                            Categorie Produs</td>
                        <td>
                            <asp:DropDownList ID="categorii_ddl" runat="server" AutoPostBack="True" 
                                DataSourceID="categorii" DataTextField="category_name" 
                                DataValueField="CategoryID">
                            </asp:DropDownList>
                        </td>
                        <td>
                            <asp:SqlDataSource ID="categorii" runat="server" 
                                ConnectionString="<%$ ConnectionStrings:StoreDBConnectionString %>" 
                                SelectCommand="SELECT * FROM [Product_Categories]"></asp:SqlDataSource>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 126px">
                            Produs</td>
                        <td>
                            <asp:DropDownList ID="produs_ddl" runat="server" AutoPostBack="True" 
                                DataSourceID="produse" DataTextField="name" DataValueField="ID">
                            </asp:DropDownList>
                        </td>
                        <td>
                            <asp:SqlDataSource ID="produse" runat="server" 
                                ConnectionString="<%$ ConnectionStrings:StoreDBConnectionString %>" 
                                SelectCommand="SELECT * FROM [Products] WHERE ([CategoryID] = @CategoryID2)">
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="categorii_ddl" Name="CategoryID2" 
                                        PropertyName="SelectedValue" Type="Int32" />
                                </SelectParameters>
                            </asp:SqlDataSource>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 126px">
                            Tip Atribut</td>
                        <td>
                            <asp:DropDownList ID="atribute_cat_ddl" runat="server" AutoPostBack="True" 
                                DataSourceID="atribute_categorii" DataTextField="atribute_name" 
                                DataValueField="ID">
                            </asp:DropDownList>
                        </td>
                        <td>
                            <asp:SqlDataSource ID="atribute_categorii" runat="server" 
                                ConnectionString="<%$ ConnectionStrings:StoreDBConnectionString %>" 
                                SelectCommand="SELECT * FROM [Atribute_Type] WHERE ([CategoryID] = @CategoryID)">
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="categorii_ddl" Name="CategoryID" 
                                        PropertyName="SelectedValue" Type="Int32" />
                                </SelectParameters>
                            </asp:SqlDataSource>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 126px">
                            Valoare Atribut</td>
                        <td>
                            <asp:DropDownList ID="atribute_val_ddl" runat="server" 
                                DataSourceID="atribute_valori" DataTextField="atribut_value" 
                                DataValueField="ID">
                            </asp:DropDownList>
                        </td>
                        <td>
                            <asp:SqlDataSource ID="atribute_valori" runat="server" 
                                ConnectionString="<%$ ConnectionStrings:StoreDBConnectionString %>" 
                                SelectCommand="SELECT * FROM [Atribute_Value] WHERE ([AtributeTypeID] = @AtributeTypeID)">
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="atribute_cat_ddl" Name="AtributeTypeID" 
                                        PropertyName="SelectedValue" Type="Int32" />
                                </SelectParameters>
                            </asp:SqlDataSource>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 126px">
                            &nbsp;</td>
                        <td>
                            &nbsp;</td>
                        <td>
                            <asp:Button ID="adauga" runat="server" onclick="adauga_Click" 
                                Text="Adauga la produs" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
        </td>
        <td style="vertical-align: top; width: 350px;">
            &nbsp;</td>
    </tr>
    <tr>
        <td style="width: 350px">
            &nbsp;</td>
        <td style="width: 585px">
            &nbsp;</td>
        <td style="vertical-align: top; width: 350px;">
            &nbsp;</td>
    </tr>
    <tr>
        <td style="width: 350px">
            &nbsp;</td>
        <td style="width: 585px">
            <asp:Panel ID="Panel2" runat="server" BorderStyle="Groove">
                <table style="width:100%;">
                    <tr>
                        <td>
                            &nbsp;</td>
                        <td>
                            Adaugare atribut nou</td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td>
                            Categorie Produs</td>
                        <td>
                            <asp:DropDownList ID="categorii2_ddl" runat="server" AutoPostBack="True" 
                                DataSourceID="categorii" DataTextField="category_name" 
                                DataValueField="CategoryID">
                            </asp:DropDownList>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td>
                            Tip Atribut</td>
                        <td>
                            <asp:DropDownList ID="atribute_cat2_ddl" runat="server" AutoPostBack="True" 
                                DataSourceID="atribute_categorii_adauga" DataTextField="atribute_name" 
                                DataValueField="ID">
                            </asp:DropDownList>
                        </td>
                        <td>
                            <asp:SqlDataSource ID="atribute_categorii_adauga" runat="server" 
                                ConnectionString="<%$ ConnectionStrings:StoreDBConnectionString %>" 
                                SelectCommand="SELECT * FROM [Atribute_Type] WHERE ([CategoryID] = @CategoryID)">
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="categorii2_ddl" Name="CategoryID" 
                                        PropertyName="SelectedValue" Type="Int32" />
                                </SelectParameters>
                            </asp:SqlDataSource>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Valoare Atribut</td>
                        <td>
                            <asp:TextBox ID="valoare" runat="server"></asp:TextBox>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp;</td>
                        <td>
                            &nbsp;</td>
                        <td>
                            <asp:Button ID="Button1" runat="server" onclick="Button1_Click" 
                                Text="Adaga atribut" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
        </td>
        <td style="vertical-align: top; width: 350px;">
            &nbsp;</td>
    </tr>
    </table>
</asp:Content>

